App.controller('AbnTestController', ['$scope', '$timeout', '$resource', function ($scope, $timeout, $resource) {
    // onSelect事件
    var apple_selected = function (branch) {
        $scope.output = "当前选中: " + branch.label;
        alert($scope.output);
        return $scope.output;
    };
    var treedata_avm = [
        {
            label: '河南省',
            children: [
                {
                    label: '郑州市'
                }, {
                    label: '开封市'
                }, {
                    label: '洛阳市'
                }, {
                    label: '周口市',
                    children: ['太康县', '西华县', '扶沟县']
                }
            ]
        }, {
            label: '河北省',
            children: [
                {
                    label: '唐山市'
                }, {
                    label: '石家庄市',
                    children: [
                        {
                            label: '无极县',
                            onSelect: apple_selected
                        }, {
                            label: '平山县',
                            onSelect: apple_selected
                        }, {
                            label: '元氏县',
                            onSelect: apple_selected
                        }
                    ]
                }
            ]
        }, {
            label: '三西省',
            children: [
                {
                    label: '太原市',
                    children: ['杏花岭区', '尖草坪区', '万柏林区']
                }, {
                    label: '大同市',
                    children: ['矿区', '南郊区', '新荣区']
                }, {
                    label: '阳泉市',
                    children: [
                        {
                            label: '平定县'
                        }, {
                            label: '盂县'
                        }
                    ]
                }
            ]
        }
    ];
    $scope.my_data = treedata_avm;
    return $scope.my_data;
}]);

